<script setup lang="ts">
import { TActivity } from "@/global";
import Taro from "@tarojs/taro";

const { source } = defineProps<{
  source: TActivity;
}>();

const handleEvent = () => {
  Taro.navigateTo({
    url: `/packageActivity/pages/activity/detail?act_id=${source.id}`,
  });
};

// const statusText = {
//   // 活动状态 0 未开始 1 进行中 2 已结束
//   0: "未开始",
//   1: "正在进行",
//   2: "已结束",
// };
</script>
<template>
  <view class="relative rounded-[26px] p-2 bg-white mb-4" @tap="handleEvent">
    <image
      class="flex w-full max-h-[302px]"
      :src="source.title_img"
      mode="aspectFill"
    />

    <view
      class="absolute bottom-0 left-0 right-0 text-light px-4 py-3 bg-black/50 rounded-b-[26px]"
    >
      <view class="whitespace-pre-line">{{ source.act_time }}</view>
    </view>

    <view
      v-if="source.is_ticket == 1"
      class="absolute right-2.5 bottom-0 px-6 py-1 translate-y-1/4 rounded-full text-light bg-dark"
    >
      ¥{{ source.min_price }}起
    </view>
  </view>
</template>
